Image processing method and image processing apparatus for extracting heading region from image of document

ABSTRACT

An image processing apparatus analyzes an image of a document to thereby extract a heading region from the image. The image processing apparatus detects candidates for the heading region from the image, and defines a predetermined range in the image as a range to be processed. The apparatus further groups the candidates in the range to be processed, based on a feature quantity corresponding to a feature in terms of style of a character string. The apparatus selects a representative group from the resultant groups, and divides the range to be processed, at the position of a candidate belonging to the representative group. The apparatus newly defines each of the portions generated by the division as a range to be processed.

This application is based on Japanese Patent Application No. 2009-223031filed with the Japan Patent Office on Sep. 28, 2009, the entire contentof which is hereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing method and an imageprocessing apparatus, and particularly to an image processing method andan image processing apparatus for extracting a heading region from animage of a document.

2. Description of the Related Art

There has conventionally been a method of extracting, from characterstring element regions in the whole image of a document, headings (titleheading, section heading) by means of a common extraction rule that isbased on a feature quantity.

For example, Document 1 (Japanese Laid-Open Patent Publication No.11-238096) describes extraction of listed elements (corresponding toheadings) from all rows on the row-by-row basis that are included in animage of a document, based on a specific feature quantity.

The technique of Document 1, however, is applied to all rows included ina document for extracting headings by means of a specific featurequantity from the whole document defined as one range. A resultantproblem has therefore been that the style of a document from whichheadings can be appropriately extracted is significantly restricted.

In other words, in the case of a document style including backgroundcharacters and repeatedly appearing small character string elements(such as itemized elements, header and footer added to a page or slideto be displayed), heading regions cannot be appropriately extracted ifthe same rule is applied to the whole document without exception.

Conventionally, in order to appropriately extract headings of aplurality of different levels from a document of such a style, it isnecessary to add a process of extracting a feature quantity and tosophisticate the rule. The addition of a feature quantity extractionprocess and the sophistication of the rule, however, add the cost andincrease the processing time, and thus fail in practice.

SUMMARY OF THE INVENTION

The present invention has been made to solve the problems as describedabove, and an object of the invention is to provide an image processingmethod and an image processing apparatus with which a heading region canappropriately be extracted even from a document of a style includingbackground characters and/or repeatedly appearing small character stringelements.

According to the present invention, an image processing method isperformed by an image processing apparatus for extracting a headingregion from an image of a document, and includes the steps of storingthe image by the image processing apparatus, and analyzing the image bythe image processing apparatus. The step of analyzing the image includesthe steps of: detecting candidates for the heading region, from aplurality of character string element regions in the image; defining arange including a plurality of the character string element regions as arange to be processed; grouping into groups the candidates within therange to be processed, based on a feature quantity corresponding to afeature in terms of style of a character string; detecting, for each ofthe groups included in the range to be processed, to what extent eachgroup includes a characteristic of the heading region; selecting, fromthe groups included in the range to be processed, a group based on theextent, as a representative group; determining that the candidatebelonging to the representative group is the heading region; dividingthe range to be processed, at a position of the heading region; andnewly defining each of portions generated by dividing the range to beprocessed, as the range to be processed.

According to the present invention, a computer-readable non-transitorymedium is encoded with a computer program for executing the imageprocessing method as described above.

According to the present invention, an image processing apparatus forextracting a heading region from an image of a document includes astorage unit for storing the image, and an analysis unit for analyzingthe image. The analysis unit detects candidates for the heading region,from a plurality of character string element regions in the image;defines a range including a plurality of the character string elementregions as a range to be processed; groups into groups the candidateswithin the range to be processed, based on a feature quantitycorresponding to a feature in terms of style of a character string;detects, for each of the groups included in the range to be processed,to what extent each group includes a characteristic of the headingregion; selects, from the groups included in the range to be processed,a group based on the extent, as a representative group; determines thatthe candidate belonging to the representative group is the headingregion; divides a portion other than the candidate belonging to therepresentative group in the defined range, at a position of thecandidate belonging to the representative group; and newly defines eachof portions other than the candidate belonging to the representativegroup that are generated by dividing the portion, as the range to beprocessed.

The foregoing and other objects, features, aspects and advantages of thepresent invention will become more apparent from the following detaileddescription of the present invention when taken in conjunction with theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic configuration diagram of a system including animage processing apparatus according to an embodiment of the presentinvention.

FIG. 2 is a block diagram showing a schematic configuration of the imageprocessing apparatus according to the embodiment of the presentinvention.

FIG. 3 is a block diagram showing a schematic configuration of apersonal computer included in the system shown in FIG. 1.

FIG. 4 is a block diagram showing a functional configuration of theimage processing apparatus according to the embodiment of the presentinvention.

FIG. 5 is a diagram showing an example of a data structure of anelectronic document generated by the image processing apparatusaccording to the embodiment of the present invention.

FIG. 6 is a diagram showing an example of a data structure of bookmarkdata included in the electronic document in the embodiment of thepresent invention.

FIG. 7 is a flowchart illustrating an image analysis process in theembodiment of the present invention.

FIG. 8 is a flowchart illustrating a character string elementdetermination process in the embodiment of the present invention.

FIG. 9 is a diagram showing an example of character string elementregions.

FIG. 10 is a diagram showing a sample document.

FIG. 11 is a diagram showing an example of character string elementregions defined for the sample document in FIG. 10.

FIG. 12 is an enlarged diagram of FIG. 11.

FIG. 13 is a diagram illustrating the result of classification ofcharacter string element regions of the sample document shown in FIG.10.

FIG. 14 is a flowchart illustrating a heading extraction process in theembodiment of the present invention.

FIG. 15 is a diagram illustrating the result of grouping of headingcandidates in a range that is the whole sample document shown in FIG.10.

FIG. 16 is a table illustrating the result of determination aboutheading that is made for groups in a range shown by (A) of FIG. 15.

FIG. 17 is a diagram illustrating the result of grouping of headingcandidates in each of ranges generated by dividing the range shown by(A) of FIG. 15.

FIG. 18 is a table illustrating the result of determination aboutheading that is made for groups in ranges shown by (A) of FIG. 17.

FIG. 19 is a diagram illustrating the result of grouping of headingcandidates in each of ranges generated by dividing a range shown by (A)of FIG. 17.

FIG. 20 is a table illustrating the result of determination aboutheading that is made for groups in ranges shown in FIG. 19.

FIG. 21 is a diagram illustrating the result of grouping of headingcandidates in each of ranges generated by dividing a range shown in FIG.19.

FIG. 22 is a table illustrating the result of determination aboutheading made for groups in ranges shown in FIG. 21.

FIG. 23 is a diagram schematically illustrating the result of theheading extraction process in the embodiment of the present invention.

FIG. 24 is a diagram showing heading regions and non-heading regionsdefined for the sample document shown in FIG. 10.

FIG. 25 is a diagram for illustrating a comparative example of theheading extraction process in the embodiment of the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

An embodiment of the present invention will be described in detail withreference to the drawings. In the drawings, the same or correspondingcomponents are denoted by the same reference characters, and adescription thereof will not be repeated.

In the present embodiment, an image processing apparatus defines ranges(step by step) to which a heading extraction rule is applied forextracting a heading from heading candidates in a document image. Forthe defined ranges each, a heading extraction rule is applied to therebyappropriately extract a heading region from a document image having avariety of document styles including headings of multiple levels.

The image processing apparatus in the present embodiment willhereinafter be described in detail.

As to Configuration

Entire System Configuration

In connection with the present embodiment, an MFP (Multi FunctionPeripheral) will exemplarily be described as a form of the imageprocessing apparatus of the present invention. It should be noted thatthe image processing apparatus of the present invention is not limitedto the MFP, and is applicable as well to a copier, a facsimileapparatus, a scanner apparatus, and the like.

Referring to FIG. 1, an MFP 1 according to the present embodimentincludes an image reader unit 104 for reading an original 300, and aprinter unit 106 for performing a printing process on a paper medium andthe like.

Especially, MFP 1 according to the present embodiment obtains a documentimage by reading original 300 with image reader unit 104, and generatesan electronic document 400 containing this document image. Typically, aformat such as PDF (Portable Document Format) can be used for electronicdocument 400. Here, MFP 1 extracts at least one heading region from thedocument image, and generates viewing navigation information foridentifying the position where the extracted heading region is locatedin the document image.

“Viewing navigation information” refers to information for assisting auser in viewing a document image contained in an electronic document,and more specifically to information for identifying the position wherea heading region or the like contained in the document image is located.By way of example, such viewing navigation information includes“bookmark”, “annotation”, “thread”, “link” and the like, and may alsoinclude a thumbnail (size-reduced image) or the like of a correspondingheading region, in addition to the information for identifying theposition of the heading region. In connection with the presentembodiment, a description will be given of a configuration using“bookmark” as a representative example of “viewing navigationinformation”.

MFP 1 stores generated electronic document 400 in its storage unit (notshown), and also transmits the electronic document to personal computersPC1, PC2, and PC3 (also referred to collectively as “personal computerPC” hereinafter) and a mobile terminal MT through a network. In anexemplary form of use, MFP 1 directly transmits electronic document 400to personal computers PC1 and PC2 connected to a LAN (Local AreaNetwork) that is a network installed in the same office in which MFP 1is installed. A server apparatus SRV is provided at a point where theLAN and a WAN (Wide Area Network) are connected, and electronic document400 is transmitted through server apparatus SRV from MFP 1 to personalcomputer PC3 and the like in an office located away from MFP 1.Furthermore, electronic document 400 is transmitted from MFP 1 to mobileterminal MT through a wireless network such as the WAN, public mobiletelephone network and wireless LAN (not shown). Here, server apparatusSRV exemplarily includes mail server, FTP (File Transfer Protocol)server, Web server, SMB server, and the like.

Image reader unit 104 includes a set tray for setting an originalthereon, a platen glass, a conveyer unit automatically conveying theoriginal set on the set tray to the platen glass one by one, and adischarge tray for discharging the read original (all are not shown).Thus, a plurality of originals can be successively read to generate oneelectronic document 400.

Schematic Configuration of MFP

Referring to FIG. 2, MFP 1 includes a control unit 100, a memory 102,image reader unit 104, printer unit 106, a communication interface 108,and a data storage unit 110.

Control unit 100 is exemplarily configured as a processing device suchas CPU (Central Processing Unit), and executes a program to therebyimplement document image processing according to the present embodiment.Memory 102 is exemplarily a volatile memory device such as DRAM (DynamicRandom Access Memory), and stores for example a program to be executedby control unit 100 and data required to execute the program.Communication interface 108 is exemplarily a component for transmittingand receiving data to and from personal computer PC (FIG. 1) and mobileterminal MT through a network (LAN shown in FIG. 1 for example), andincludes a LAN adaptor and driver software for controlling the LANadaptor. Printer unit 106 is a component for performing a printingprocess, and includes a control device for controlling operation of eachcomponent in addition to a hardware configuration for the printingprocess. Data storage unit 110 is exemplarily a hard disk device or anonvolatile memory device such as flash memory, and stores electronicdocument 400 and the like generated by control unit 100.

Configuration of Personal Computer

Referring to FIG. 3, personal computer PC includes a CPU (CentralProcessing Unit) 201 executing various kinds of programs including anoperating system (OS), a memory 213 temporarily storing data required toexecute a program by CPU 201, and a hard disk drive (HDD) 211 storing aprogram to be executed by CPU 201 in a nonvolatile manner. In addition,hard disk drive 211 stores a viewing application for displaying anelectronic document generated by MFP 1, and such a program is read froma memory card (SD card for example) 217 a or a CD-ROM (Compact Disk-ReadOnly Memory) 215 a by an input/output interface 217 or a CD-ROM drive215, or the like.

CPU 201 receives an instruction from a user through an input device 209such as keyboard and mouse, and outputs a screen output generatedthrough execution of a program to a display unit 205. CPU 201 alsoobtains an electronic document from MFP 1 and server SRV (FIG. 1)connected to the LAN and the WAN through a communication interface 207including a LAN card or the like, and stores the electronic document inhard disk drive 211 or the like. Further, the above components exchangedata with each other through an internal bus 203.

Here, since mobile terminal MT is substantially equivalent to the oneshown in FIG. 3 from which CD-ROM drive 215 for example is removed, thedetailed description will not be repeated.

Functional Configuration of MFP

Referring to FIG. 4, a functional configuration of MFP 1 includes imagereader unit 104, an image pre-processing unit 12, an image buffer unit13, a compression processing unit 14, an electronic document generationunit 15, an image analysis unit 16, a bookmark data generation unit 17,a transmission unit 18, an image processing unit 19, and printer unit106. The functions of MFP 1 are mainly implemented by control unit 100and memory 102 (FIG. 2) for example of MFP 1.

Image reader unit 104 obtains a document image by reading original 300,and outputs the document image to image pre-processing unit 12. Imagepre-processing unit 12 adjusts display characteristics and the like ofthe document image mainly for making them suitable for display onpersonal computer PC and the like. Furthermore, image pre-processingunit 12 may remove noise contained in the document image. Then, thedocument image having undergone image processing by image pre-processingunit 12 is transmitted to image buffer unit 13.

Image buffer unit 13 is a component temporarily storing the data of theobtained document image, and outputs the temporarily stored documentimage to compression processing unit 14, image analysis unit 16, andimage processing unit 19.

Compression processing unit 14 compresses the document image that isoutput from image buffer unit 13, and outputs the resultant documentimage to electronic document generation unit 15. The degree ofcompression by this compression processing may be changed depending onthe size of an electronic document to be generated and a requiredresolution of the document image for example. Further, the compressionprocessing may be irreversible conversion such as JPEG (JointPhotographic Experts Group). In addition, where a high resolution isrequired for example, the compression processing may not be performed.

Image analysis unit 16 analyzes the document image that is output fromimage buffer unit 13, and extracts a heading region. Image analysis unit16 includes a detection unit 161 and a heading extraction unit 162 asits functions.

Detection unit 161 divides the document image into a plurality ofcharacter string element regions, and detects heading candidates amongthe plurality of character string element regions. In the presentembodiment, a plurality of character string element regions areclassified into a small region and a large region, and a small region isdetected as a heading candidate, and a large region is detected as text.The classification into a small region and a large region is based on,for example, the size of a region (such as the number of rows, the area,the number of characters), and whether or not the region containsspecific characters (such as characters less frequently used for aheading, period, and other punctuation marks).

In the present embodiment, “character string element regions” refer toregions each surrounding one or a series of rows and distinguished fromother regions by the preceding and following spaces and/or punctuationmarks, and correspond to paragraph (text), heading, and header andfooter regions. A specific example of how to define the character stringelement regions will be described hereinafter.

Heading extraction unit 162 extracts heading regions from the headingcandidates detected by detection unit 161. For this purpose, headingextraction unit 162 performs the following process.

For detected heading candidates, heading extraction unit 162 defines arange (step by step) to which a heading extraction rule is applied.Heading candidates (small regions) within the defined range are groupedbased on a feature quantity representing a predetermined style type.

“Style type” refers to an item for identifying a feature in terms of thestyle of a character string, and includes the amount of indent, theheight of a row, the color of characters, the background color, thecentral position of a region, justification, the line width ofcharacters, respective distances from the preceding character stringelement region and the following character string element region,character string modifications (underline, border), the character size,the character spacing, font, character modifications (bold, italic), andthe like. In the present embodiment, it is desirable to determine inadvance a style type that is effective in distinguishing logicalelements from each other, as a style type to be used for groupingheading candidates. Specifically, for example, “amount of indent(left-side starting position)” and “height of a row” are used as styletypes. A region having respective feature quantities of these styletypes (namely the value indicating the left-side starting position andthe value indicating the height of a row) and a region having featurequantities similar to the aforementioned feature quantities areidentified as belonging to the same group. For example, regions having adistribution of the feature quantity (value) of the left-side startingposition and a distribution of the feature quantity (value) of theheight of a row that fall within respective predetermined ranges areidentified as belonging to the same group.

Heading extraction unit 162 detects group characteristics group bygroup, applies a predetermined heading extraction rule (describedhereinafter) to the results of detection of the group characteristics,and thereby selects (detects) a group representing the range(hereinafter “representative group”). The representative group is agroup of heading candidates having characteristics (features) that aremost like those of a heading, in the defined range.

“Group characteristics” refer to information aboutlikelihood/unlikelihood that a candidate is a heading, namelyinformation that is effective in determining whether a heading candidatebelonging to a group is a heading representing a range. The groupcharacteristics include the above-described feature quantities of thestyle types used for grouping candidates, namely i) “left-side startingposition” and ii) “height of a row”, and further include, as featuresthat depend on a defined range, at least one of the uppermost positionof a heading candidate in the defined range, and the relation in termsof the order between a heading candidate and a text (large region) inthe defined range. Specifically, as the former feature, iii) “positionof the most upstream heading candidate within a group” is used. As thelatter feature, iv) “whether a heading candidate located upstream of alltext regions in the range is included” and v) “whether a headingcandidate without being followed by a text located downstream in therange is included” are used.

It is desirable that heading extraction unit 162 excludes, from therepresentative group, a group that does not satisfy a predeterminedcriterion when a heading extraction rule is applied to the results ofdetection of the group characteristics (less than a predeterminedthreshold for example). Such a process can be added to avoid erroneousdetermination about the heading.

Heading extraction unit 162 determines that a heading candidate includedin the representative group is a heading region. It may be determinedthat a heading candidate belonging to the group excluded from therepresentative group is a non-heading-candidate. Namely, it may bedetermined that a heading candidate within a range including only thegroup excluded from the representative group is not a heading.

Heading extraction unit 162 divides the original range based on theposition of the heading candidate included in the representative group.Specifically, the defined range is divided at a position before or afterthe heading candidate belonging to the representative group. Amongranges generated by dividing the original range, only a range(s)including a heading candidate for which the determination about whetherthe heading candidate is a heading or not has not been made is a newlydefined range(s).

Heading extraction unit 162 performs again the process similar to theabove-described one on the ranges generated by the division, Thus, theprocess from the grouping of heading candidates to the division of therange is repeated until there is no range that can be defined.

In this way, the results of detection of group characteristics thatdepend on the defined range is used to select the representative groupthat is most likely to be a heading. Heading regions can therefore beextracted appropriately from a document image having a variety ofdocument styles including headings of multiple levels.

Heading extraction unit 162 outputs information about the headingcandidates identified as heading regions (such as positionalinformation) to bookmark data generation unit 17.

Bookmark data generation unit 17 generates bookmark data based on theinformation about the heading regions that is output from image analysisunit 16. Bookmark data generation unit 17 may also include, in thebookmark data, information about a specific logical element (such asfigure, table, and caption) other than the heading. Bookmark datageneration unit 17 outputs the generated bookmark data to electronicdocument generation unit 15.

Electronic document generation unit 15 generates an electronic documentby adding the bookmark data from bookmark data generation unit 17 to thedocument image compressed by compression processing unit 14. Then, thegenerated electronic document is stored in data storage unit 110 oroutput to transmission unit 18, depending on for example the setting bya user. Transmission unit 18 is implemented by communication interface108, and transmits the electronic document generated by electronicdocument generation unit 15 to personal computer PC (FIG. 1) for examplethrough the network such as LAN.

Meanwhile, image processing unit 19 converts the document image that isoutput from image buffer unit 13 into an image suitable for the printingoperation by printer unit 106, in accordance with a user's operation. Inan exemplary case, a document image defined by the RGB display system isconverted into image data of the CMYK display system or the likesuitable for color printing. At this time, the color may be adjustedbased on the characteristics of printer unit 106. Printer unit 106performs a printing process on a paper medium or the like based on theimage data that is output from image processing unit 19.

It should be noted that the operation of each functional block may beimplemented by execution of software stored in memory 102, or at leastone of functional blocks may be implemented by hardware.

Example of Data Structure of Electronic Document

Referring to FIG. 5, electronic document 400 includes a header section402, a document image section 404, a bookmark data section 406, and afooter section 408. Header section 402 and footer section 408 storeinformation about attributes of electronic document 400 such as date andtime of creation, creator, and copyright information. Document imagesection 404 stores a document image corresponding to each page. Thisdocument image may be stored in the compressed state as described above.Bookmark data section 406 stores the bookmark data for specifying aheading region included in the document image, that is, a characterstring element region (small region) identified as a heading.

Referring to FIG. 6, the bookmark data stores, in association with eachheading region, the page number, the region's upper left coordinates,the region's lower right coordinates, and the type of the element, forexample. The page number is positional information for specifying a pagewhere the associated heading region is present. The region's upper leftcoordinates and the region's lower right coordinates are positionalinformation for specifying the position (rectangle) of the associatedheading region in the page. The type of the element is information forspecifying the type of the associated heading region. It should be notedthat the bookmark data may further include positional information abouta document element (region) of a type other than the heading.

As to Operation

The process executed by image analysis unit 16 (hereinafter referred toas “image analysis process”) is the most characteristic process amongthe processes executed by MFP 1. Therefore, details of the imageanalysis process will hereinafter be described.

Referring to a flowchart shown in FIG. 7, a description will be given ofthe image analysis process in this embodiment of the present invention.The process shown in the flowchart of FIG. 7 is stored as a program inadvance in memory 102, and control unit 100 reads and executes thisprogram and thereby the function of the image analysis process isimplemented.

Referring to FIG. 7, image analysis unit 16 inputs data of a documentimage (step S2). The input data of the document image is stored on aninternal memory page by page.

Then, the data of each page on the internal memory is read and a contentregion is determined (step S4). The content region is a partial regionof each page and each content region includes characters of oneparagraph.

“Content region” refers to a region corresponding to one paragraph on apage, and is set at the same position with respect to each page. Thecontent region can be determined by any of various existing methods.

For example, a projection histogram in the vertical direction isgenerated for a density image of a page, and lateral positions of thecontent region are obtained from the position having the lower totaldensity. Similarly, a projection histogram in the lateral direction isgenerated, and vertical start and end positions of the content regionare obtained.

Then, image analysis unit 16 determines a row region (step S6). The rowregion can be determined by any of various existing methods. Forexample, a projection histogram in the lateral direction is generatedfor the density image of the content region, and the positions of upperand lower ends of each row region are determined from the positionhaving the lower total density.

Subsequently, image analysis unit 16 determines a character stringelement region (character string element determination process) (stepS8). The character string element region is generated by integrating rowregions. Image analysis unit 16 controls the integration using the sizeof the rightmost space of each row region and the type of the lastcharacter of the row.

Referring to a flowchart of FIG. 8, a description will be given of thecharacter string element determination process in this embodiment of thepresent invention.

With reference to FIG. 8, one character string element region in aninitial state is generated first (step S102). Then, one unprocessed rowregion is obtained, following the order of reading (step S104). Morespecifically, the row region located uppermost in the leftmost contentregion on the page of the smallest page number is obtained.

Here, it is determined whether or not the row region has beensuccessfully obtained in step S104 (step S106). When there is nounprocessed row region, it is determined that the row region has notbeen obtained successfully (NO in step S106), and the process proceedsto step S114.

In contrast, when the row region has been obtained successfully (YES instep S106), the obtained row region is integrated into the characterstring element region (step S108).

Next, image analysis unit 16 determines whether or not the obtained rowregion is the last row (step S110). More specifically, it is determinedwhether the rightmost space of the obtained row region is of apredetermined value or more, or whether the type of the last characterof the row is a period. The predetermined value of the rightmost spaceis set for example to the height of characters included in the rowregion. When it is determined that the obtained row region is the lastrow (YES in step S110), the process proceeds to step S112. Otherwise (NOin step S110), the process returns to step S104, and the above steps arerepeated.

In step S112, image analysis unit 16 completes the character stringelement region. After this step, the process proceeds to step S114.

In step S114, it is determined whether or not all content regions havebeen processed. When there is an unprocessed content region (NO in stepS114), the process returns to step S102. When there is no unprocessedcontent region (YES in step S114), the character string elementdetermination process is completed.

Referring to FIG. 9, an example of the character string element regionwill be described.

It is supposed that (A) of FIG. 9 shows a part of row regions determinedin step S6 of FIG. 7. (B) of FIG. 9 shows the result of thedetermination of character string element regions performed on the rowregions shown by (A) of FIG. 9.

It is determined in step S110 that row regions LE1, LE11, LE14, LE15,and LE23, each have a rightmost space. Row regions LE1 and LE15 thusform respective character string element regions CE1# and CE4# bythemselves. Row regions LE2 to LE11, LE12 to LE14, and LE16 to LE23 areintegrated in the vertical direction to generate character stringelement regions CE2#, CE3#, and CE5#, respectively.

It should be noted that, in the case where a character string elementregion has a rightmost space, the region except for the rightmost spaceis set as a character string element region.

In the present embodiment, the character string element regions aredefined by the above-described method. The method is not limited to theparticular one, and the character string element regions may be definedby a known method.

A process executed by image analysis unit 16 after the character stringelement regions are defined will be described using an exemplary sampledocument shown in FIG. 10.

FIG. 10 is a diagram showing sample document 30 in which backgroundcharacters are inserted. Sample document 30 shown in FIG. 10 is an imageobtained by image reader unit 104 and stored in image buffer unit 13. Insample document 30, background characters “PROJECT A” and “2009ACTIVITIES” are repeatedly inserted. As such background characters areinserted, a reader who sees only a part of the document can confirm asubject of the document.

An example of character string element regions defined for sampledocument 30 in FIG. 10 is shown in FIG. 11.

Referring to FIG. 11, for sample document 30, character string elementregions CE1 to CE21 are defined. FIG. 12 is a partially enlarged diagramof FIG. 11.

Character string element regions CE1 to CE21 shown in FIG. 11 will beused as an example to describe a subsequent process.

Referring again to FIG. 7, when the character string elementdetermination process is completed, detection unit 161 of image analysisunit 16 classifies the character string element regions into a largeregion and a small region (step S10). More specifically, the area ofeach character string element region, the average height of charactersin the whole document, and the average width of the content region inthe whole document, for example, are determined. When the area of thecharacter string element region is larger than (average height ofcharacters in the whole document)×(average width of the content regionin the whole document)×2, it is determined that the character stringelement region is a large region, and otherwise, it is determined thatthe character string element region is a small region.

Alternatively, it may be determined that a character string elementregion is a small region when the region is smaller than a predeterminedvalue (one row for example). Likewise, it may be determined that acharacter string element region is a large or small region, from thenumber of characters in the region.

FIG. 13 is a diagram illustrating the result of classification ofcharacter string element regions CE1 to CE21 in sample document 30. InFIG. 13, (A) schematically shows character string element regions CE1 toCE21 each in a rectangular form in sample document 30, and (B)illustrates the result of classification of character string elementregions CE1 to CE21 shown by (A).

Referring to FIG. 13, it is determined that character string elementregions CE5, CE10, CE16, CE18, and CE21 are large regions BE1 to BE5,respectively. It is also determined that remaining regions CE1 to CE4,CE6 to CE9, CE11 to CE15, CE17, CE19, and CE20 are small regions SE1 toSE16, respectively.

Small regions SE1 to SE16 are treated as candidates for heading regions(hereinafter referred to as “heading candidates”). Large regions BE1 toBE5 are treated as text regions.

Then, a process of extracting heading regions from heading candidatesSE1 to SE16 which are small regions (heading extraction process) isexecuted (step S12).

FIG. 14 is a flowchart illustrating the heading extraction process inthe present embodiment.

Referring to FIG. 14, heading extraction unit 162 first defines thewhole document as a range to be processed (step S102). Specifically, therange including all character string element regions CE1 to CE21 in thedocument image (namely heading candidates SE1 to SE16 and text regionsBE1 to BE5) is defined as a range to be processed.

Heading extraction unit 162 groups heading candidates SE1 to SE16 in thedefined range into groups each constituted of heading candidates havingrespective feature quantities of a predetermined style type that aresimilar to each other (step S104). Namely, heading candidates that areidentical or within a predetermined range in terms of both of theleft-side starting position and the height of a row are defined asbelonging to the same group.

FIG. 15 is a diagram illustrating the result where the whole of sampledocument 30 is defined as a range R1 and heading candidates SE1 to SE16in range R1 are grouped into groups. (A) of FIG. 15 illustrates anexample where all character string element regions, namely range R1including heading candidates SE1 to SE16 and text regions BE1 to BE5,are defined as a range to be processed. (B) of FIG. 15 illustrates theresult of grouping of heading candidates (small regions) SE1 to SE16 inrange R1 shown by (A) of FIG. 15.

Referring to (B) of FIG. 15, heading candidates SE1, SE2, SE5, SE6, SE9,SE10, SE12, SE13, SE15, and SE16 belong to “Group 1”. Heading candidateSE3 belongs to “Group 2”. Heading candidates SE4, SE7, and SE14 belongto “Group 3”. Heading candidates SE8 and SE11 belong to “Group 4”.

Heading extraction unit 162 detects group characteristics group by group(step S106), In the present embodiment, for each group, i) “left-sidestarting position”, ii) “height of a row”, and iii) “position of aheading candidate located most upstream in the group” are used as thegroup characteristics. Then, it is detected iv) “whether a headingcandidate located upstream of all text regions in the range is included”and v) “whether a heading candidate without followed by a text regionlocated downstream in the range is included”.

After detecting these group characteristics, heading extraction unit 162compares the results of detection following a predetermined headingextraction rule and accordingly selects a group representing the range(step S108). A heading candidate included in the selected group isconfirmed as a heading region.

The heading extraction rule is applied to determine whether the resultsof detection of the group characteristics i) to v) indicate thelikelihood that a heading candidate is a heading. Here, the rule isdefined as adding or subtracting a point in advance to each result ofdetection. Heading extraction unit 162 determines that a group havingthe maximum total point is a group representing the range(representative group). Here, the condition applied to each of the groupcharacteristics i) to v) and the point to be added or subtracted are asfollows:

-   -   i) a group where “left-side starting position” is located        leftmost (small indent amount): point +1;    -   ii) a group where “height of a row” is largest: point +1;    -   iii) a group where the position of the most upstream heading        candidate is located uppermost in the range: point +1;    -   iv) a group including a heading candidate located upstream        relative to all texts in the range: point +5; and    -   v) a group including a heading candidate without followed by a        text located downstream in the range: point −10.

It should be noted that the weight of the point to be added/subtractedfor each of the above-described group characteristics is not limited tothe above-described one.

FIG. 16 is a table illustrating the result of determination about theheading made for Groups 1 to 4 in range R1. The information as shown inFIG. 16 is temporarily recorded on a work area of memory 102 for examplein the heading extraction process.

In the table of FIG. 16, Groups 1 to 4 are described in the columndirection. In the row direction, seven items namely the number ofheadings, i) left-side starting position, ii) height of a row, iii) mostupstream position, iv) whether or not a candidate region (headingcandidate) located upstream of all texts is included, and v) whether ornot a candidate region (heading candidate) without followed by a textlocated downstream is included, and the total point are described.

For the item of the number of headings, the number of included headingcandidates is recorded for each group.

In the cells under the items from i) left-side starting position to v)whether or not a candidate region (heading candidate) without followedby a text located downstream is included, the results of detection arerecorded in the upper row, and the points for the results to which theabove-condition (extraction rule) is applied are recorded in the lowerrow.

For the item of the total point, the total point is recorded for eachgroup.

Heading extraction unit 162 determines whether a representative group ispresent in the range (step S110). Specifically, when there is no grouphaving the total point of not less than a predetermined threshold (point5 for example) in the range, it is determined that a representativegroup is absent in the range. In other words, when the total point of agroup having the maximum total point in the range is less than thethreshold, this group is excluded from the representative group. Thus,it is determined that the range does not include a representative group.

When a representative group is present in the range (YES in step S110),namely when a group having the total point of not less than 5 ispresent, it is determined that a heading candidate belonging to therepresentative group is a heading region (step S112). In range R1, Group2 has the total point of 7. It is therefore determined that Group 2 is arepresentative group, and it is determined that a heading candidate inGroup 2 is a heading region.

In contrast, when it is determined that a representative group is notpresent in the range (NO in step S110), namely there is no group havingthe total point of not less than 5, it is determined that the range doesnot include a group of a heading candidate that is likely to be aheading, and the process proceeds to step S118.

In step S118, it is determined whether or not an unprocessed rangeremains. When an unprocessed range is present (YES in step S118),heading extraction unit 162 defines the unprocessed range as a range tobe processed (step S120). When an unprocessed range is not present (NOin step S118), the heading extraction process is ended.

In this way, a threshold is set for the total point, and a range assumedto include no group of a heading candidate that is likely to be aheading is excluded from the determination about the heading. Thus, thetime for the heading extraction process can be shortened.

After step S112, heading extraction unit 162 outputs the positionalinformation about the heading region to bookmark data generation unit 17(step S114).

Subsequently, original range R1 is divided at the position of theheading region belonging to the representative group (step S116). Rangesgenerated by the division are newly defined as unprocessed ranges. Oneof the defined unprocessed ranges (a range located upstream for example)is defined as a range to be processed. In the present embodiment,original range R1 is divided by removing the portion between the upperside and the lower side of the heading region belonging to therepresentative group.

After the range is divided, the process returns to step S104 and theabove-described process is repeated for the range to be processed.

Thus, for the two ranges generated by dividing range R1 shown by (A) ofFIG. 15, the process in steps S104 to S116 is executed again.

FIG. 17 is a diagram illustrating the result of grouping of headingcandidates SE1 to SE2 and SE4 to SE16 in two ranges R11 and R12respectively generated by dividing range R1 shown by (A) of FIG. 15(step S104). (A) of FIG. 17 illustrates an example where two ranges R11and R12 are defined with respect to the position of the heading (smallregion SE3) belonging to the representative group (Group 2) in theoriginal range R1. (B) of FIG. 17 illustrates the result of grouping ofheading candidates (small regions) in each of ranges R11 and R12 shownby (A) of FIG. 17.

In range R11, heading candidates SE1 and SE2 belong to “Group 1_(—)1”.In range R12, heading candidates SE5, SE6, SE9, SE10, SE12, SE13, SE15,and SE16 belong to Group 1_(—)2”. Groups 3 and 4 in range R12 are thesame as those in range R1.

The result of determination about the heading made for the groups inranges R11 and R12 is illustrated in FIG. 18.

(A) of FIG. 18 shows a table illustrating the result of determinationabout the heading made for Group 1_(—)1 in range R11. Referring to (B)of FIG. 17 and (A) of FIG. 18, range R11 includes Group 1_(—)1 only, andno text region is present in range R11. Therefore, for such Group 1_(—)1in range R11, the determination about the heading may be ended withoutapplying the heading extraction rule.

(B) of FIG. 18 shows a table illustrating the result of determinationabout the heading made for Group 1_(—)2, Group 3, and Group 4 in rangeR12, In range R12, Group 3 has the maximum total point that is not lessthan the threshold (point 5). From range R12, therefore, Group 3 isselected as a representative group (step S108, YES in step S110).Accordingly, it is determined that heading candidates SE4, SE7, and SE14belonging to Group 3 are heading regions, and the positional informationabout these regions SE4, SE7, and SE14 is output to bookmark datageneration unit 17 (steps S112, S114).

FIG. 19 is a diagram illustrating an example where original range R12 isdivided into three ranges R21, R22, and R23 with respect to respectivepositions of the headings (regions SE4, SE7, SE14) belonging to therepresentative group (Group 3) in range R12.

For ranges R21, R22, and R23 each, heading candidates are again grouped(step S104). In range R21, heading candidates SE5 and SE6 belong to“Group 1_(—)2_(—)1” In range R22, heading candidates SE9, SE10, SE12,and SE13 belong to “Group 1_(—)2_(—)2”. In range R22, Group 4 is thesame as that in range R1. In range R23, heading candidates SE15 and SE16belong to “Group 1_(—)2_(—)3”.

The result of determination about the heading for the groups in rangesR21, R22, and R23 is illustrated in FIG. 20.

In FIG. 20, (A) shows a table illustrating the result of determinationabout the heading made for Group 1_(—)2_(—)1 in range R21, (B) shows atable illustrating the result of determination about the heading madefor Group 1_(—)2_(—)2 and Group 4 in range R22, and (C) shows a tableillustrating the result of determination about the heading made forGroup 1_(—)2_(—)3 in range R23.

Referring to (A) of FIG. 20, range R21 includes text region BE1, andtext region BE1 is located most upstream in range R21. The total pointof Group 1_(—)2_(—)1 is therefore a small value of −7. Thus, because thetotal point of Group 1_(—)2_(—)1 is less than the threshold (point 5),it is determined that range R21 does not include a representative group(NO in step S110). Accordingly, Group 1_(—)2_(—)1 is excluded fromheading candidates.

Referring to (B) of FIG. 20, Group 4 in range R22 has the maximum totalpoint that is not less than point 5. Therefore, from range R22, Group 4is selected as a representative group (step S108, YES in step S110).Thus, it is determined that heading candidates SE8 and SE11 belonging toGroup 4 are heading regions, and the positional information about theseregions SE8 and SE11 is output to bookmark data generation unit 17(steps S112, S114).

Referring to (C) of FIG. 20, the total point of Group 1_(—)2_(—)3 inrange R23 is 3 that is less than the threshold (point 5). It istherefore determined that range R23 does not include a representativegroup (NO in step S110). As a result, Group 1_(—)2_(—)3 is excluded fromheading candidates.

FIG. 21 is a diagram illustrating an example where original range R22including the representative group is divided into two ranges R31 andR32 with respect to respective positions of the headings (regions SE8,SE11) belonging to the representative group (Group 4) in range R22.

For ranges R31 and R32 each, the heading candidates are grouped again(step S104). In range R31, heading candidates SE9 and SE10 belong to“Group 1_(—)2_(—)3_(—)1”. In range R32, heading candidates SE12 and SE13belong to “Group 1_(—)2_(—)3_(—)2”.

The result of determination about the heading made for the groups inranges R31 and R32 is illustrated in FIG. 22.

(A) of FIG. 22 shows a table illustrating the result of determinationabout the heading made for Group 1_(—)2_(—)3_(—)1 in range R31. (B) ofFIG. 22 shows a table illustrating the result of determination about theheading made for Group 1_(—)2_(—)3_(—)2 in range R32.

Referring to (A) of FIG. 22, range R31 includes text region BE2, andtext region BE2 is located most upstream in range R31. Therefore, thetotal point of Group 1_(—)2_(—)3_(—)1 is a small value of −7. Thus,because the total point of Group 1_(—)2_(—)3_(—)1 is less than thethreshold (point 5), it is determined that range R31 does not include arepresentative group (NO in step S110). As a result, Group1_(—)2_(—)3_(—)1 is excluded from heading candidates.

Referring to (B) of FIG. 22, the total point of Group 1_(—)2_(—)3_(—)2in range R32 is 8 which is not less than point 5. It is thereforedetermined that Group 1_(—)2_(—)3_(—)2 is a representative group ofrange R32 (step S108, YES in step S110). Accordingly, it is determinedthat heading candidates SE12 and SE13 belonging to Group1_(—)2_(—)3_(—)2 are heading regions, and the positional informationabout these regions SE12 and SE13 is output to bookmark data generationunit 17 (steps S112, S114).

New ranges defined at the positions of the headings belonging to Group1_(—)2_(—)3_(—)2, however, include no heading candidate, and thereforeinvalid.

FIGS. 23 and 24 show heading regions defined for sample document 30shown in FIG. 10.

Referring to FIG. 23, among the small regions (heading candidates) SE1to SE16 shown by (B) of FIG. 13, regions SE3, SE4, SE7, SE8, and SE11 toSE14 except for the gray regions are identified as heading regions.These regions belong to Group 2, Group 3, Group 4, and Group1_(—)2_(—)3_(—)2 extracted as groups (representative groups) of headingsas a result of the above-described process.

Small regions SE1, SE2, SE5, SE6, SE9, SE10, SE15, and SE16 that aregray regions are the regions belonging to Group 1_(—)1, Group1_(—)2_(—)1, Group 1_(—)2_(—)3, and Group 1_(—)2_(—)3_(—)1 excluded fromheading candidates as a result of the above-described process.

Referring to FIG. 24, it is seen that heading candidates SE1, SE2, SE5,SE6, SE9, SE10, SE15, and SE16 that are identified as non-headingscorrespond to regions of background characters.

As heretofore described, according to the present embodiment, headingscan be extracted appropriately, even from a document in which backgroundcharacters are repeatedly inserted, by narrowing the range step by stepand using feature quantities of a few style types (the left-sidestarting position and the height of a row) for which calculation iseasy.

COMPARATIVE EXAMPLE

A description will be given of determination about the heading made forthe whole document defined as one range without being narrowed forsample document 30 shown in FIG. 10, as a comparative example of thepresent embodiment.

For the comparative example as well, it is supposed that characterstring element regions (small regions) SE1 to SE16 that are headingcandidates as shown by (B) of FIG. 13 are detected.

FIG. 25 is a diagram for illustrating the comparative example of theheading extraction process in the embodiment of the present invention.

In FIG. 25, for heading candidates SE1 to SE16 each, respective featurequantities of the above-described style types “left-side startingposition” and “height of a row” are indicated.

Conventional grouping applies, to all of heading candidates SE1 to SE16,a rule of grouping heading candidates similar to each other in terms ofthe left-side starting position and the height of a row into the samegroup. The result of this grouping is illustrated in the rightmostcolumn of FIG. 25. It is noted that the result of grouping in thecomparative examine is the same as that for range R1 in the presentembodiment.

In the comparative example, Group 1 includes both of backgroundcharacters and headings. Therefore, in this state, headings cannot beextracted appropriately. Even if the rule of selecting a group issubsequently applied, it is not determined that heading candidates SE12and SE13 are headings or it is erroneously determined that backgroundcharacters are headings.

While a feature quantity of a style type that can distinguish headingcandidates SE12 and SE13 from the background characters may possibly beadded, selection of an effective style type depends on the document typeand is therefore not easy. Further, addition of a style type used forthe determination requires addition of a new process, resulting inincrease in cost and processing time.

In contrast, the present embodiment appropriately defines a range towhich the heading extraction rule is applied, and group characteristicsin the range are used to extract headings. Therefore, MFP 1 is alsoadaptable to a plurality of headings of different levels.

Modifications

Depending on the level of refinement in defining the ranges which isperformed in the heading extraction process, heading regions may belayered. This will be described using above-described sample document 30as an example. It is supposed that range R1 first defined for sampledocument 30 is level 1, ranges R11 and R12 into which range R1 isdivided are level 2, ranges R21, R22, and R23 into which range R12 isdivided are level 3, and ranges R31 and R32 into which range R22 isdivided is level 4. Thus, the heading regions can be layered in such amanner that heading regions of level 1 (namely heading regions extractedfrom range R1) belong to the highest layer, and heading regions of level2 (namely heading regions extracted from range R12) belong to the layersubsequent to that of the heading regions of level 1, for example. Inother words, the range can be divided (narrowed) to detect the relationbetween the headings in terms of which heading region belong to whichheading region.

In the case where heading regions are layered in the above-describedmanner, data about the layer of each heading region may also be outputto bookmark data generation unit 17. Bookmark data generation unit 17may layer bookmark to be attached to PDF based on the layer data abouteach heading region.

Further, bookmark data generation unit 17 may attach, as the bookmark,only heading regions of a layer selected by a user (heading regions oflayers 1 to 3 for example). Alternatively, before the heading extractionprocess, a user may specify the number of layers for the headingextraction, and then the heading extraction may be ended when the levelof the layer specified by the user is reached. In this way, the form ofuse may be changed for each layer of headings to improve the conveniencein creation of the bookmark.

While the above-described embodiment uses the left-side startingposition and the height of a row, as style types to be used forgrouping, other style types that are significant in terms of the layoutmay be used as well. For example, the color of characters, thebackground color, the central position of a region, difference betweenregions in justification (left justification, right justification, andcenter justification are identified to group them into differentgroups), the line width of characters, respective distances to regionsimmediately above and below, and the like may also be used. From thesestyle types, a user may select those used for grouping. The user canselect style types appropriate for grouping, taking into considerationdifferences in characteristic (attribute) between a heading and thoseother than the heading (such as background characters) in a document tobe processed. In this way, a document of a wider variety of styles canbe processed.

Further, the above-described embodiment may use other features (items)that depend on a defined range, as group characteristics used for a rulefor evaluating groups.

For example, the features include to what degree the number of headingcandidate regions in a group is small (a higher point is given to thesmaller number of regions), the magnitude of the distance along thedirection of reading from the most upstream heading candidate region andthe most downstream heading candidate region in a group (a higher pointis given to a larger distance), and the like. Thus, items depending on adefined range may further be used so that a document of a wider varietyof styles can be processed. Accordingly, the precision in headingextraction can further be improved.

Moreover, the present embodiment supposes that the contents of adocument proceed from the top toward the bottom. In the case where thecontents of a document proceed between the top and the bottom like amulti-column layout or the like, whether a region of interest is locatedupstream or downstream along the direction in which the contents proceedmay be determined so that such a document can be processed as well.

In addition, the image processing method performed by the imageprocessing apparatus in the present embodiment may be provided in theform of a program. Such a program can also be provided in the form of aprogram product recorded on an optical medium such as CD-ROM (CompactDisc-ROM) or a computer-readable non-transitory recording medium such asmemory card. Further, the program can also be provided by beingdownloaded through a network.

Furthermore, the program according to the present invention may beexecuted by calling a necessary module in a predetermined arrangement ata predetermined timing, among program modules provided as a part of anoperating system (OS) of a computer. In this case, the program itselfdoes not include the module and the process is executed in cooperationwith the OS. Such a program without module may also be included in theprogram according to the present embodiment.

In addition, the program according to the present embodiment may beincorporated in another program and then provided. In this case as well,the program itself does not include a module included in the otherprogram, and the process is executed in cooperation with the otherprogram. Such a program incorporated in another program may also beincluded in the program according to the present embodiment.

The program product as provided is installed in a program storage suchas hard disk and then executed. It should be noted that the programproduct includes a program itself and a storage medium where the programis stored.

Although the present invention has been described and illustrated indetail, it is clearly understood that the same is by way of illustrationand example only and is not to be taken by way of limitation, the scopeof the present invention being interpreted by the terms of the appendedclaims.

What is claimed is:
 1. An image processing method performed by an imageprocessing apparatus for extracting a heading region from an image of adocument, comprising: storing said image by said image processingapparatus; and analyzing said image by said image processing apparatus,said analyzing said image comprising: detecting candidates for saidheading region, from a plurality of character string element regions insaid image; defining a range including a plurality of said characterstring element regions as a range to be processed; grouping into groupssaid candidates within said range to be processed, based on position ofthe candidates and size of a row within the candidates; quantitativelydetermining, for each of said groups included in said range to beprocessed, an extent to which each of said groups corresponds to saidheading region, based on position of the candidates within each of saidgroups and size of a row within the candidates within each of saidgroups; selecting, from said groups included in said range to beprocessed, a group that corresponds most to said heading based on saidextent, as a representative group; determining that said candidatebelonging to said representative group is said heading region; dividingsaid range to be processed, at a position of said heading region; andnewly defining each of portions generated by dividing said range to beprocessed, as said range to be processed.
 2. A non-transitorycomputer-readable medium encoded with a computer program for executingthe method according to claim
 1. 3. An image processing apparatus forextracting a heading region from an image of a document, comprising: astorage unit configured to store said image; and an analysis unitconfigured to analyze said image, said analysis unit being configuredto: detect candidates for said heading region, from a plurality ofcharacter string element regions in said image; define a range includinga plurality of said character string element regions as a range to beprocessed; group into groups said candidates within said range to beprocessed, based on position of the candidates and size of a row withinthe candidates; quantitatively determine, for each of said groupsincluded in said range to be processed, an extent to which each of saidgroups corresponds to said heading region, based on position of thecandidates within each of said groups and size of a row within thecandidates within each of said groups; select, from said groups includedin said range to be processed, a group that corresponds most to saidheading based on said extent, as a representative group; determine thatsaid candidate belonging to said representative group is said headingregion; divide sub-ranges other than said candidate belonging to saidrepresentative group in said defined range, at a position of saidcandidate belonging to said representative group; and newly define eachof the divided sub-ranges other than said candidate belonging to saidrepresentative group, as said range to be processed.
 4. The imageprocessing apparatus according to claim 3, wherein said position of thecandidates and said size of a row within the candidates includes afeature that depends on said defined range.
 5. The image processingapparatus according to claim 4, wherein said analysis unit further uses,as said position of the candidates and size of a row within thecandidates, a quantity corresponding to a feature in terms of style of acharacter string for said groups each.
 6. The image processing apparatusaccording to claim 5, wherein said feature that depends on said definedrange includes at least one of an uppermost position of said candidatesin said defined range, and a relation in terms of order with respect toa text region that is a region other than said candidates in saiddefined range.
 7. The image processing apparatus according to claim 6,wherein said analysis unit classifies a plurality of said characterstring element regions into a small region and a large region, detectssaid small region as said candidate, and detects said large region assaid text region.
 8. The image processing apparatus according to claim3, wherein said analysis unit divides said defined range at a positionpreceding or following said candidate belonging to said representativegroup.
 9. The image processing apparatus according to claim 8, whereinsaid analysis unit further excludes, from said representative group, agroup that does not satisfy a predetermined criterion when an extractionrule is applied to a result of detection of said characteristic.
 10. Theimage processing apparatus according to claim 9, wherein said analysisunit further excludes from said candidates, said candidate in a rangeincluding only the group excluded from said representative group. 11.The image processing apparatus according to claim 10, wherein saidanalysis unit makes a determination, for each of defined rangesgenerated by dividing said defined range, about whether a group of saidcandidates included in the range includes only the group excluded fromsaid representative group, and said analysis unit newly defines a rangein which a heading candidate for which the determination has not beenmade is present, as said range to be processed.
 12. The image processingapparatus according to claim 3, wherein said analysis unit layers saidcandidates used for dividing said defined range, based on a relation interms of layers generated by the division.